using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DM.DAO;
using DM.Entity;

namespace DM.Web
{
    public partial class ViewList : System.Web.UI.UserControl
    {
        private List<TinTuc> listTin = new List<TinTuc>();
        public List<TinTuc> ListTin
        {
            get { return listTin; }
            set { listTin = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (listTin != null)
                {
                    Repeater2.DataSource = listTin;
                    Repeater2.DataBind();
                }
            }
        }

        public static string ImageUrl(string matin)
        {
            TinTucDAO _tinTucDao = new TinTucDAO();
            TinTuc tinTuc = _tinTucDao.Get(Common.ParseInt32(matin));
            HinhDAO _hinhDao = new HinhDAO();
            Hinh hinh = _hinhDao.Get(tinTuc);
            return "../"+hinh.Hinhurl;
        }
    }
}